#pragma once
#ifndef ENGINE_HPP
#define ENGINE_HPP

#include "flecs.h"
#include "Model.hpp"
#include "Camera.hpp"
#include "Shader.hpp"

#include "Objects/Object3D.hpp"
#include "Objects/OmniLight3D.hpp"
#include "Objects/SpotLight3D.hpp"

#include <vector>
#include <string>
#include <iostream>


const std::string DEFAULT_VERT       =   "shaders/default.vert";
const std::string DEFAULT_FRAG       =   "shaders/default.frag";
const std::string DEFAULT_FRAG_MARK  =   "shaders/mark.frag";
const std::string DEFAULT_FRAG_LIGHT =   "shaders/lamp.frag";


class Engine
{
public:
	Camera* camera;
	flecs::world world_ecs;

	uint8_t num_omni, num_spot;
	float time, prev_time, period;

	Engine(GLFWwindow*, const char*);

	void draw();
	Object3D* addObject3D(std::string name, std::string modelPath);
	OmniLight3D* addOmniLight3D(std::string name, float power, const vec3& color = vec3(1.f), std::string modelPath = "");
	SpotLight3D* addSpotlight3D(std::string name, glm::vec2 power_and_cutoff, const vec3& color = vec3(1.f), std::string modelPath = "");
	const Shader* addShaderProgram(std::string name, std::string vs, std::string fs) const;
	inline void activateLight() const
	{
		world_ecs.lookup("core_base").get<Shader>()->use();
	};
	
	//void Highlight(std::string name);

private:
	std::string prefix;

	/*void draw_object(Object*& object);
	void draw_highlighted_object(Object*& object);*/
};
#endif // ENGINE_HPP